﻿using System;

class CartesianCoordinateSystem
{
    static void Main()
    {
        //C# Fundamentals 2011/2012 Part 1 - Sample Exam
        checked
        {
            double numberX = double.Parse(Console.ReadLine());
            double numberY = double.Parse(Console.ReadLine());

            if (numberX == 0 && numberY == 0)
            {
                Console.WriteLine(0);
            }
            else if (numberX > 0 && numberY > 0)
            {
                Console.WriteLine(1);
            }
            else if (numberX < 0 && numberY > 0)
            {
                Console.WriteLine(2);
            }
            else if (numberX < 0 && numberY < 0)
            {
                Console.WriteLine(3);
            }
            else if (numberX > 0 && numberY < 0)
            {
                Console.WriteLine(4);
            }
            else if (numberX == 0)  // Y може да е положително и отрицателно число
            {
                Console.WriteLine(5);
            }
            else
            {
                Console.WriteLine(6);
            }
            
        }
        

    }
}

